<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../js/jquery-1.8.0.min.js"></script>
<title>Insert title here</title>
<script type="text/javascript">
	$(function(){
		$("#t").keyup(function(){
			var len = $(this).val().length;
			var i=$("#t").clone();
			var j=$("<input type=button value=删除>");
			j.click(function(){
				i.remove();
				j.remove();
			});
			if(len==8){
				$("#main").append(i).append(j);
				$("#t").val("");
			}
		});
	});
</script>
</head>
<body>
<input type="text" name="t" id="t">
<form action="#" method="post" >
<div id="main" style="width: 300px;background-color: gray;"></div>
<input type="submit" value="入库">
</form>
</body>
</html>